import Http from '../../http';
import {download} from '../../../library/commonUtil';

//分页查询接口
export const pageApi = function(param: any) {
    return Http.get('/sys-dict/page', param)
}

//添加修改接口
export const saveApi = function(param: any) {
    return Http.post('/sys-dict/save', param)
}

//删除接口
export const removeApi = function(id: number) {
    return Http.post('/sys-dict/remove/'+id)
}

//详情接口
export const infoApi = function(id: number) {
    return Http.get('/sys-dict/info/'+id)
}

//导出接口
export const exportApi = function(param: any) {
    download('字典信息.xlsx','/sys-dict/export', param);    
}

//修改字典项接口
export const saveItemApi = function(param: any) {
    return Http.post('/sys-dict/save-item', param)
}

//字典项列表接口
export const itemListApi = function(param: any) {
    return Http.get('/sys-dict/item-list',param)
}

//字典下拉框选项接口
export const dictSelectApi = function(param: any) {
    return Http.get('/sys-dict/item-select/'+param)
}